- Print
- DarkLight
Managing the Knowledge Base Widget
You can easily manage your Knowledge base widget in Document360. All options are available just a few clicks away.
Securing Knowledge base widget authentication using JWT
You can implement an authentication configuration for the widget using JWT, ensuring a secure environment for private and mixed projects.
-
In your , go to the Knowledge base widget. The list of widgets will be listed
-
Hover over the desired widget and click Edit (✎)
-
In Installation & setup → JWT, enable the JWT toggle

-
Client ID: The client ID will be your project’s ID
-
Widget ID: Since multiple widgets may exist, Widget ID is provided for their unique purposes.
-
Token endpoint: A token endpoint is an HTTP endpoint that allows you to obtain an access token given an authorization code
-
Client secret: Click Regenerate to generate the client secret. You have to save this for future purposes and the same client secret will apply to all the widgets in the future
Client secret will be required for JWT widgets you may create. Note that this information will not be stored in Document360.
-
Authorize URL: Paste the authorized URL from your knowledge base widget webpage
-
Once done, click Save.
The same authorized URL will be embedded inside the code. Copy and paste the code into your script selection on your webpage.
An authenticated widget will be successfully implemented, which is secured so that a third-party person can’t access the widgets.
How to implement the auth endpoint?
[HttpGet]
[Route("authenticate")]
public async Task<IActionResult> WidgetAuthentication(string id)
{
if (HttpContext.User.Identity.IsAuthenticated)
{
var clientData = new ClientDetails()
{
ClientId = "{Client ID}",
Secret = "{Client secret}",
TokenEndpoint = "{Token endpoint}",
WidgetId = "{Widget ID}",
SecurityGroupIds = "{Comma separated reader group IDs}",
TokenValidity = 15, // integer representing token validity in minutes
};
if (clientData == null)
return NotFound();
List<string> readerGroupids = null;
if (!string.IsNullOrEmpty(clientData.SecurityGroupIds))
readerGroupids = clientData.SecurityGroupIds.Split(',').Select(c => c.Trim()).ToList();
var payload = new
{
username = "{Username}",
firstName = "{First name}",
lastName = "{Last name}",
emailId = "{Email address}",
readerGroupIds = readerGroupids,
tokenValidity = clientData.TokenValidity,
widgetId = clientData.WidgetId,
projectId = clientData.ClientId
};
var payloadString = JsonConvert.SerializeObject(payload);
var result = await client.RequestTokenAsync(new TokenRequest
{
Address = clientData.TokenEndpoint,
ClientId = clientData.ClientId,
ClientSecret = clientData.Secret,
GrantType = "Widget",
Parameters =
{
{
"payload", payloadString
},
{
"id", clientData.ClientId
},
}
});
return Ok(new
{
accessToken = result.AccessToken,
expiresIn = result.ExpiresIn
});
}
else
{
return Unauthorized(new { success = false });
}
}
Edit Knowledge base widget

-
Go to Settings → Knowledge base widget
-
Hover over the desired Knowledge base widget and click Edit
-
Update the desired configurations
-
Click Save
Clone Knowledge base widget

-
Go to Settings → Knowledge base widget
-
Hover over the desired Knowledge base widget from which you want to clone and click Clone
-
Type a title and click Create
-
Update the desired configurations
-
Click Save
Delete Knowledge base widget

-
Go to Settings → Knowledge base widget
-
Hover over the desired Knowledge base widget you want to delete and click Delete
-
Click Yes in the confirmation prompt
Copy script of Knowledge base widget

-
Go to Settings → Knowledge base widget
-
Hover over the desired Knowledge base widget you want to delete and click Copy script
-
Paste the copied script in your website or Knowledge base HTML section to insert the Knowledge base widget